package cn.com.cifi.mars.bean.dto;

import cn.com.cifi.mars.util.NumberUtils;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * 月初存货,月度新供,月度综合
 * @author Administrator
 *
 */
@Data
@ApiModel(value = "月初存货,月度新供,月度综合", description = "月初存货,月度新供,月度综合")
public class YearEarlyBottomDto {

	@ApiModelProperty(name = "name", value = "月份")
	private String name;

	@ApiModelProperty(name = "f_monthlyInventoryNum", value = "<月初存货>月初存货套数")
	private String f_monthlyInventoryNum;
	@ApiModelProperty(name = "f_monthlyInventoryAmount", value = "<月初存货>月初存货金额")
	private String f_monthlyInventoryAmount;
	@ApiModelProperty(name = "f_signingPlanNum", value = "<月初存货>签约计划套数")
	private String f_signingPlanNum;
	@ApiModelProperty(name = "f_signingPlanAmount", value = "<月初存货>签约计划金额")
	private String f_signingPlanAmount;
	@ApiModelProperty(name = "f_signingActualNum", value = "<月初存货>签约实际金额")
	private String f_signingActualNum;
	@ApiModelProperty(name = "f_signingActualAmount", value = "<月初存货>签约实际金额")
	private String f_signingActualAmount;
	@ApiModelProperty(name = "f_signingRateAmount", value = "<月初存货>签约达成率")
	private String f_signingRateAmount;
	@ApiModelProperty(name = "f_planDeChemicalRateAmount", value = "<月初存货>计划去化率")
	private String f_planDeChemicalRateAmount;

	@ApiModelProperty(name = "g_supplyPlanNum", value = "<月度新供>供货计划套数")
	private String g_supplyPlanNum;
	@ApiModelProperty(name = "g_supplyPlanAmount", value = "<月度新供>供货计划金额")
	private String g_supplyPlanAmount;
	@ApiModelProperty(name = "g_supplyPlanActualNum", value = "<月度新供>供货实际套数")
	private String g_supplyPlanActualNum;
	@ApiModelProperty(name = "g_supplyPlanActualAmount", value = "<月度新供>供货实际金额")
	private String g_supplyPlanActualAmount;
	@ApiModelProperty(name = "g_supplyPlanRateAmount", value = "<月度新供>供货达成率")
	private String g_supplyPlanRateAmount;
	@ApiModelProperty(name = "g_signingPlanNum", value = "<月度新供>签约计划套数")
	private String g_signingPlanNum;
	@ApiModelProperty(name = "g_signingPlanAmount", value = "<月度新供>签约计划金额")
	private String g_signingPlanAmount;
	@ApiModelProperty(name = "g_signingActualNum", value = "<月度新供>签约实际套数")
	private String g_signingActualNum;
	@ApiModelProperty(name = "g_signingActualAmount", value = "<月度新供>签约实际金额")
	private String g_signingActualAmount;
	@ApiModelProperty(name = "g_signingRateAmount", value = "<月度新供>签约达成率")
	private String g_signingRateAmount;
	@ApiModelProperty(name = "g_planDeChemicalRateAmount", value = "<月度新供>计划去化率")
	private String g_planDeChemicalRateAmount;

	@ApiModelProperty(name = "h_monthlyAvailableNum", value = "<月度综合>月度可售套数")
	private String h_monthlyAvailableNum;
	@ApiModelProperty(name = "h_monthlyAvailableAmount", value = "<月度综合>月度可售金额")
	private String h_monthlyAvailableAmount;
	@ApiModelProperty(name = "h_signingPlanNum", value = "<月度综合>签约计划套数")
	private String h_signingPlanNum;
	@ApiModelProperty(name = "h_signingPlanAmount", value = "<月度综合>签约计划金额")
	private String h_signingPlanAmount;
	@ApiModelProperty(name = "h_signingActualNum", value = "<月度综合>签约实际套数")
	private String h_signingActualNum;
	@ApiModelProperty(name = "h_signingActualAmount", value = "<月度综合>签约实际金额")
	private String h_signingActualAmount;
	@ApiModelProperty(name = "h_signingRateAmount", value = "<月度综合>签约达成率")
	private String h_signingRateAmount;
	@ApiModelProperty(name = "h_planDeChemicalRateAmount", value = "<月度综合>计划去化率")
	private String h_planDeChemicalRateAmount;

	//基础数据初始化
	public void initialize(){
		this.f_monthlyInventoryNum = NumberUtils.stringInitial(2,5);
		this.f_monthlyInventoryAmount = NumberUtils.stringInitial(3,4);
		this.f_signingPlanNum = NumberUtils.stringInitial(2,5);
		this.f_signingPlanAmount = NumberUtils.stringInitial(3,4);
		this.f_signingActualNum = NumberUtils.stringInitial(2,5);
		this.f_signingActualAmount = NumberUtils.stringInitial(3,4);
		this.g_supplyPlanNum = NumberUtils.stringInitial(2,5);
		this.g_supplyPlanAmount = NumberUtils.stringInitial(3,4);
		this.g_supplyPlanActualNum = NumberUtils.stringInitial(2,5);
		this.g_supplyPlanActualAmount = NumberUtils.stringInitial(3,4);
		this.g_signingPlanNum = NumberUtils.stringInitial(2,5);
		this.g_signingPlanAmount = NumberUtils.stringInitial(3,4);
		this.g_signingActualNum = NumberUtils.stringInitial(2,5);
		this.g_signingActualAmount = NumberUtils.stringInitial(3,4);
		this.h_monthlyAvailableNum = NumberUtils.stringInitial(2,5);
		this.h_monthlyAvailableAmount = NumberUtils.stringInitial(3,4);
	}

	//计算百分率
	public void calculatedPercentage(){
		// 月初存货签约达成率(月初存货签约实际金额/月初存货签约计划金额)
		this.f_signingRateAmount = NumberUtils.pricePercentage(this.f_signingActualAmount,this.f_signingPlanAmount);
		// 月初存货计划去化率(月初存货签约计划金额/月初存货金额)
		this.f_planDeChemicalRateAmount = NumberUtils.pricePercentage(this.f_signingPlanAmount,this.f_monthlyInventoryAmount);
		// 供货达成率(月度新供供货实际金额/月度新供供货计划金额)
		this.g_supplyPlanRateAmount = NumberUtils.pricePercentage(this.g_supplyPlanActualAmount, this.g_supplyPlanAmount);
		// 月度新供签约达成率(月度新供签约实际金额/月度新供签约计划金额)
		this.g_signingRateAmount = NumberUtils.pricePercentage(this.g_signingActualAmount, this.g_signingPlanAmount);
		// 月度新供实际去化率(月度新供签约计划金额/月度新供供货计划金额)
		this.g_planDeChemicalRateAmount = NumberUtils.pricePercentage(this.g_signingPlanAmount, this.g_supplyPlanAmount);

		// 月度综合签约计划套数(月度新供签约计划套数+月初存货签约计划套数)
		this.h_signingPlanNum = NumberUtils.numAdd(this.g_signingPlanNum, this.f_signingPlanNum);
		// 月度综合签约计划金额(月度新供签约计划金额+月初存货签约计划金额)
		this.h_signingPlanAmount = NumberUtils.priceAdd(this.g_signingPlanAmount, this.f_signingPlanAmount);
		// 月度综合签约实际套数(月度新供签约实际套数+月初存货签约实际套数)
		this.h_signingActualNum = NumberUtils.numAdd(this.g_signingActualNum, this.f_signingActualNum);
		// 月度综合签约实际金额(月度新供签约实际金额+月初存货签约实际金额)
		this.h_signingActualAmount = NumberUtils.priceAdd(this.g_signingActualAmount, this.f_signingActualAmount);
		// 月度综合签约达成率(月度综合签约实际金额/月度综合签约计划金额)
		this.h_signingRateAmount = NumberUtils.pricePercentage(this.h_signingActualAmount, this.h_signingPlanAmount);
		// 月度综合计划去化率(月度综合签约计划金额/月度综合月度可售金额)
		this.h_planDeChemicalRateAmount = NumberUtils.pricePercentage(this.h_signingPlanAmount, this.h_monthlyAvailableAmount);
	}
}
